<?php


  function IGallery_ajax_main() {
  
  }


  function IGallery_ajax_multipleupload() {

    $hc    = FormUtil::getPassedValue ('hc', false , 'REQUEST');      
    $script_dir = "resource/igallery_upload/".$hc."/";

       
    Loader::loadClass('UploadHandler', "modules/IGallery/pnincludes");    

    $options = array(
        'upload_dir' => $script_dir.'/images/',
        'upload_url' => $script_dir.'/images/',
        'thumbnails_dir' => $script_dir.'/thumbs/',
        'thumbnails_url' => $script_dir.'/thumbs/',
        'thumbnail_max_width' => 80,
        'thumbnail_max_height' => 80,
        'field_name' => 'file'
    );
    
    $upload_handler = new UploadHandler($options);
        
    switch ($_SERVER['REQUEST_METHOD']) {
        case 'HEAD':
        case 'GET':
            $upload_handler->get();
            break;
        case 'POST':
            $upload_handler->post();
            break;
        case 'DELETE':
            $upload_handler->delete();
            break;
        default :
            header('HTTP/1.0 405 Method Not Allowed');
    }
    
    return true;
  }
?>




